package com.xq.shop.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author gaoxiaojin
 */
@Configuration
public class MyConfig extends WebMvcConfigurerAdapter {

    @Value("${xq.file.path}")
    private String filePath;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/qfile/**").addResourceLocations("file:" + filePath);
    }
}
